﻿using System.Web.Mvc;
using CodeCamp.Models.DevSat;

namespace CodeCamp.Controllers
{
  public class DevSatController : Controller
  {
    // GET: /DevSat/

    public ActionResult Index( string eventName )
    {
      int eventId = EventsHelper.GetEventId( eventName );
      var repository = new CodeCampDataRepository();
      var eventDisplayName = repository.GetEvent( eventId ).DisplayName;

      var model =
        new DevSatIndexViewModel
        {
          EventDisplayName = eventDisplayName
        };

      return View( model );
    }

  }
}
